<!DOCTYPE html>
<html lang="en">
<head>
<title>Matrix Admin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="css/uniform.css" />
<link rel="stylesheet" href="css/select2.css" />
<link rel="stylesheet" href="css/matrix-style.css" />
<link rel="stylesheet" href="css/matrix-media.css" />
<link href="font-awesome/css/font-awesome.css" rel="stylesheet" />
<link
	href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800'
	rel='stylesheet' type='text/css'>
<style type="text/css">
	button.btn:border-radius: 5px;
</style>


</head>
<body>

	<!--Header-part-->
	<div id="header">
		<h1>
			<a href="dashboard.html">Matrix Admin</a>
		</h1>
	</div>
	<!--close-Header-part-->

	<!--top-Header-menu-->
	<div id="user-nav" class="navbar navbar-inverse">
		<ul class="nav">
			<li class="dropdown" id="profile-messages"><a title="" href="#"
				data-toggle="dropdown" data-target="#profile-messages"
				class="dropdown-toggle"><i class="icon icon-user"></i> <span
					class="text">Welcome User</span><b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="#"><i class="icon-user"></i> My Profile</a></li>
					<li class="divider"></li>
					<li><a href="#"><i class="icon-check"></i> My Tasks</a></li>
					<li class="divider"></li>
					<li><a href="login.html"><i class="icon-key"></i> Log Out</a></li>
				</ul></li>
			<li class="dropdown" id="menu-messages"><a href="#"
				data-toggle="dropdown" data-target="#menu-messages"
				class="dropdown-toggle"><i class="icon icon-envelope"></i> <span
					class="text">Messages</span> <span class="label label-important">5</span>
					<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a class="sAdd" title="" href="#"><i class="icon-plus"></i>
							new message</a></li>
					<li class="divider"></li>
					<li><a class="sInbox" title="" href="#"><i
							class="icon-envelope"></i> inbox</a></li>
					<li class="divider"></li>
					<li><a class="sOutbox" title="" href="#"><i
							class="icon-arrow-up"></i> outbox</a></li>
					<li class="divider"></li>
					<li><a class="sTrash" title="" href="#"><i
							class="icon-trash"></i> trash</a></li>
				</ul></li>
			<li class=""><a title="" href="#"><i class="icon icon-cog"></i>
					<span class="text">Settings</span></a></li>
			<li class=""><a title="" href="login.html"><i
					class="icon icon-share-alt"></i> <span class="text">Logout</span></a></li>
		</ul>
	</div>

	<!--start-top-serch-->
	<div id="search">
		<input type="text" placeholder="Search here..." />
		<button type="submit" class="tip-bottom" title="Search">
			<i class="icon-search icon-white"></i>
		</button>
	</div>
	<!--close-top-serch-->

	<!--sidebar-menu-->

	<div id="sidebar">
		<a href="#" class="visible-phone"><i class="icon icon-th"></i>Tables</a>
		<ul>
			<li class="active"><a href="allclasses.html"><i
					class="icon icon-home"></i> <span>所有班级</span></a></li>
			<li><a href="charts.html"><i class="icon icon-signal"></i> <span>Charts
						&amp; graphs</span></a></li>
			<li><a href="widgets.html"><i class="icon icon-inbox"></i> <span>Widgets</span></a>
			</li>
			<li><a href="tables.html"><i class="icon icon-th"></i> <span>Tables</span></a></li>
			<li><a href="grid.html"><i class="icon icon-fullscreen"></i>
					<span>Full width</span></a></li>
			<li class="submenu"><a href="#"><i class="icon icon-th-list"></i>
					<span>Forms</span> <span class="label label-important">3</span></a>
				<ul>
					<li><a href="form-common.html">Basic Form</a></li>
					<li><a href="form-validation.html">Form with Validation</a></li>
					<li><a href="form-wizard.html">Form with Wizard</a></li>
				</ul></li>
			<li><a href="buttons.html"><i class="icon icon-tint"></i> <span>Buttons
						&amp; icons</span></a></li>
			<li><a href="interface.html"><i class="icon icon-pencil"></i>
					<span>Eelements</span></a></li>
			<li class="submenu"><a href="#"><i class="icon icon-file"></i>
					<span>Addons</span> <span class="label label-important">5</span></a>
				<ul>
					<li><a href="index2.html">Dashboard2</a></li>
					<li><a href="gallery.html">Gallery</a></li>
					<li><a href="calendar.html">Calendar</a></li>
					<li><a href="chat.html">Chat option</a></li>
				</ul></li>
			<li class="submenu"><a href="#"><i
					class="icon icon-info-sign"></i> <span>Error</span> <span
					class="label label-important">4</span></a>
				<ul>
					<li><a href="error403.html">Error 403</a></li>
					<li><a href="error404.html">Error 404</a></li>
					<li><a href="error405.html">Error 405</a></li>
					<li><a href="error500.html">Error 500</a></li>
				</ul></li>
			<li class="content"><span>Monthly Bandwidth Transfer</span>
				<div
					class="progress progress-mini progress-danger active progress-striped">
					<div style="width: 77%;" class="bar"></div>
				</div> <span class="percent">77%</span>
				<div class="stat">21419.94 / 14000 MB</div></li>
			<li class="content"><span>Disk Space Usage</span>
				<div class="progress progress-mini active progress-striped">
					<div style="width: 87%;" class="bar"></div>
				</div> <span class="percent">87%</span>
				<div class="stat">604.44 / 4000 MB</div></li>
		</ul>
	</div>
	<div id="content">
		<div id="content-header">
			<div id="breadcrumb">
				<a href="index.html" title="回到首页" class="tip-bottom"><i
					class="icon-home"></i> 首页 </a> <a href="#" class="current">所有班级</a>
			</div>
			
			<h1>
			
				<button type="button" class="btn btn-warning">（警告）Warning</button>
					<button type="button" class="btn btn-danger">（危险）Danger</button>
			</h1>
			
		</div>
		<div class="container-fluid">

			<!-- 创建数据表格 -->
			<div class="bs-example" data-example-id="condensed-table">
				<table class="table table-bordered table-striped" id="classes_table">
					<thead>
						<tr>
							<th width="1%"><input type="checkbox"></th>
							<th width="3%">#</th>
							<th>班级编号</th>
							<th>讲师</th>
							<th>班主任</th>
							<th>学生数量</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td><input type="checkbox"></td>
							<td>1</td>
							<td>Mark</td>
							<td>Otto</td>
							<td>@mdo</td>
						</tr>
						<tr>
							<td><input type="checkbox"></td>
							<td>2</td>
							<td>Jacob</td>
							<td>Thornton</td>
							<td>@fat</td>
						</tr>
						<tr>
							<td><input type="checkbox"></td>
							<td>3</td>
							<td>Larry the Bird</td>
							<td>@fat</td>
							<td>@twitter</td>
						</tr>
					</tbody>
				</table>
			</div>
			<!-- 创建数据表格 -->




		</div>
	</div>
	<!--Footer-part-->
	<div class="row-fluid">
		<div id="footer" class="span12">
			2019 &copy; QPT-老张. Brought to you by <a
				href="allclasses.html">DL-ETC QPT.in</a>
		</div>
	</div>
	<!--end-Footer-part-->
	<script src="js/jquery.min.js"></script>
	<script src="js/jquery.ui.custom.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/jquery.uniform.js"></script>
	<script src="js/select2.min.js"></script>
	<script src="js/jquery.dataTables.min.js"></script>
	<script src="js/matrix.js"></script>
	<script src="js/matrix.tables.js"></script>
	<script type="text/javascript" src="comm/layer/layer.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		toPage(1);
	});
	function toPage(cpage){
		$.get("classes/classesWithAll",{'cpage':cpage},function(data){
			if(data.code==-1){
				layer.msg('所有班级信息获取失败',{'time':'1500',icon:2});
				toPage(1);
			}
		 	else {
				printClasses4Table('#classes_table tbody',data);
		 	}
			
		},"json");
	}
	function printClasses4Table(selector,data){
		$(selector).empty();
		var arr=data.msg.pageInfo.list;
		console.log(arr);
		$.each(arr,function(index,element){
			var tdCheckbox=$('<td></td>').append($('<input type="checkbox">'));
			var tdNo=$('<td></td>').html(index+1);
			var tdClassid=$('<td></td>').html(element.classId);
			var tdTeacher=$('<td></td>').html(element.empTeacher.ename);
			var tdCounsellor=$('<td></td>').html(element.empCounsellor.ename);
			var tdNumber=$('<td></td>').html(element.students.length);
			var btnEdit=$('<button></button>')
			var tdBtns=
			$('<tr></tr>').append(tdCheckbox).append(tdNo).append(tdClassid).append(tdTeacher).append(tdCounsellor).append(tdNumber).appendTo($(selector));
			
		});
	}
</script>
</body>
</html>
